home *** CD-ROM | disk | FTP | other *** search
- Path: coranto.ucs.mun.ca!usenet
- From: saustin@terra.nlnet.nf.ca (Steve Austin)
- Newsgroups: comp.lang.c++
- Subject: Re: Can you overload a constructor?
- Date: Sun, 17 Mar 1996 16:45:04 GMT
- Organization: Kickham Productions
- Message-ID: <4ihfi4$5pu@coranto.ucs.mun.ca>
- References: <Do859K.K9B@watserv3.uwaterloo.ca> <31493335.8C5@germany.ncr.com>
- NNTP-Posting-Host: n104h131.nlnet.nf.ca
- X-Newsreader: Forte Agent .99b.112
-
- Arnold Bursian <arnold.bursian@germany.ncr.com> wrote:
- >jfournie@sciborg.uwaterloo.ca wrote:
- >> I am new to C++ and just wanted to make sure it
- >> was OK to overload a constructor. gnu c++
- >> doesn't have a problem with it, but is it normally
- >> done?
-
- >Sure, you do it all the time! Just make sure you're calling one of the parent's constructors.
-
- [snip]
-
- The original question was can you *overload* a constructor, not about
- constructors with parameters in derived classes. This is not what
- overloading means.
-
- Of course you can overload a constructor - for example, the compiler
- will generate a default copy constructor if you don't define your own.
- Same function name, different signature, defined in the same scope.
-
- Steve
-
-
-